home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util1 / shell-10.lha / shell-1.0 / test_unix_if < prev   
Text File  |  1995-12-07  |  696b  |  49 lines

  1.  
  2. set file test_if3
  3. if [ -L $file ]
  4. then
  5.     echo $file is a link
  6. elif [ -S $file ]
  7. then
  8.     echo $file is a socket
  9. elif [ -b $file ]
  10. then
  11.     echo $file is a block special
  12. elif [ -c $file ]
  13. then
  14.     echo $file is a character special
  15. elif [ -d $file ]
  16. then
  17.     echo $file is a directory
  18. elif [ -f $file ]
  19. then
  20.     echo $file is a regular file
  21. fi
  22.  
  23. if [ -e $file ]
  24. then
  25.     echo $file exists
  26. fi
  27. if [ -r $file ]
  28. then
  29.     echo $file is readable
  30. fi
  31. if [ -w $file ]
  32. then
  33.     echo $file is writable
  34. fi
  35. if [ -r $file ]
  36. then
  37.     echo $file is executable
  38. fi
  39.  
  40. set file2 test_if
  41. list ($file|$file2)
  42.  
  43. if [ $file -nt $file2 ]
  44. then
  45.     echo $file is newer than $file2
  46. else
  47.     echo $file is older than $file2
  48. fi
  49.